Database that stores data for a three-dimensional mesh

ABSTRACT

A database includes a vertex array that contains coordinates of a three-dimensional mesh, a face array that contains pointers to target coordinates in the vertex array, the target coordinates defining a polygon in the three-dimensional mesh, a free vertex container that identifies elements in the vertex array that do not contain vertices, and a free face container that identifies elements in the face array that do not contain pointers.

TECHNICAL FIELD

[0001] This invention relates generally to a database that stores data for a three-dimensional mesh and to a process for generating the database.

BACKGROUND

[0002] A 3D mesh (or “model”) is made up of one or more polygons that define its outer surface or “skin”. Removing polygons from the surface decreases the number of polygons in the 3D mesh and, thus, reduces the granularity of the surface.

DESCRIPTION OF THE DRAWINGS

[0003]FIG. 1 is a perspective view of a 3D mesh.

[0004]FIG. 2 is a perspective view of the 3D mesh after it has been adaptively simplified.

[0005]FIG. 3 is a flowchart of a process for generating a database that defines the 3D mesh.

[0006]FIG. 4 shows arrays in the database.

[0007]FIG. 5 is a block diagram of a graphics rendering process that uses the database.

[0008]FIG. 6 is a perspective view of computer hardware that can be used to implement the process of FIG. 3.

DETAILED DESCRIPTION

[0009]FIG. 1 shows a 3D mesh 10. FIG. 2 shows 3D mesh 10 after it has been subjected to adaptive simplification. In more detail, 3D mesh 10 (FIG. 2) is comprised of interconnecting polygons 16. Polygons 16 are triangles in this embodiment; however, other types of polygons may be used. The polygons are defined by two or more vertices. The vertices may be defined by Cartesian XYZ coordinates, for example.

[0010] Adaptive simplification is used to reduce detail in specific areas of a 3D mesh, while preserving detail in other areas of the 3D mesh. Detail is reduced by removing polygons from the initial surface (e.g., FIG. 1) of the 3D mesh. For example, portion 14 of 3D mesh 10 (FIG. 2) has had polygons removed, whereas portion 12 of 3D mesh 10 (for which greater detail is desired, such as peaks of a mountain), retains more polygons than portions 14. The portions of 3D mesh 10 that are to be simplified are determined by adaptive parameter(s) that identify which portions of 3D mesh 10 are to be simplified. The adaptive parameters may be stored in association with polygons for 3D mesh 10.

[0011] 3D geometry is often viewed from the perspective of a virtual camera that moves through a 3D space occupied by a 3D landscape mesh, such as 3D mesh 10. Adaptive simplification is performed to reduce the number of polygons in 3D mesh 10 as those polygons are viewed by the virtual camera. For example, high levels of granularity of 3D mesh 10 may not be required while the virtual camera is in motion, which enables faster and more efficient 3D rendering. Thus, relatively large numbers of polygons may be removed during motion. When the virtual camera stops, slows down, revisits and/or focuses-in on an object in 3D mesh 10, a higher granularity may be desired, resulting in removal of fewer polygons from the initial surface (FIG. 1) stored in memory.

[0012] Other types of adaptive metrics may be used to perform adaptive simplification. For example, moving the virtual camera to a different portion of 3D mesh 10 can result in portions of the 3D mesh within a predetermined range of the camera retaining more polygons than other portions of the 3D mesh outside of the predetermined range.

[0013] Adaptively simplifying a 3D mesh in the manner described above involves deleting and/or adding polygons to 3D mesh 10. Heretofore, the polygons were stored in linked lists, in which vertices were stored separately for each polygon. This configuration did not allow polygons to share vertices, thus requiring large amounts of data to define a mesh. Moreover, graphics accelerator cards often have difficulty processing linked lists efficiently, making it difficult to change the granularity of the 3D mesh surface rapidly.

[0014] Accordingly, a process 20 (FIG. 3) generates (and updates) a database for storing polygons of an adaptive 3D mesh using arrays instead of linked lists. FIG. 4 shows the structure of a database 22 that is generated according to process 20. Database 22 includes a vertex array 24, a free vertex container 26, a face array 28, and a free face container 30. Free face container 30 and free vertex container 26 may be arrays or any other type of storage construct (e.g., hash tables).

[0015] Vertex array 24 is comprised of numbered elements 32. Each of these elements contains either coordinates of the 3D mesh (e.g., Cartesian XYZ coordinates) or an indication (e.g., “empty”) that the element does not contain coordinates. Elements that do not contain coordinates are referred to herein as “holes” of the 3D mesh. In addition to coordinates, the elements of vertex array 24 may include additional information relating to the vertices defined by the coordinates. For example, vertex array 24 may include up to eight texture coordinates (e.g., U₁V₁ . . . U₈V₈) for a vertex, color data/coordinates for the vertex, and/or any other information that defines the vertex with greater specificity.

[0016] Vertex array 24 does not store coordinates in numbered elements that are greater than a predetermined number. This keeps the size of vertex array 24 relatively manageable. Coordinates that are added to vertex array 24 are added to the “holes”, i.e., the empty elements, as described below. As a result, the need for a large vertex array is reduced.

[0017] Free vertex container 26 identifies elements of vertex array 24 that do not contain coordinates, i.e., it identifies the holes. Free vertex container 26 stores pointers to such elements. In this embodiment, the pointers are the numbers of the elements containing holes (e.g., elements “2”, “4” of free vertex container 26 correspond to “empty” elements “2”, “4”, respectively, in vertex array 24).

[0018] Face array 28 is also comprised of numbered elements 34. Each of these elements contains pointers to coordinates in vertex array 24 or an indication {“0, 0, 0 (empty)”} that the element does not contain pointers. As above, elements that do not contain pointers are referred to herein as “holes”.

[0019] In this embodiment, the pointers are numbers that refer to coordinates stored in vertex array 24. For example, “element 0” of face array 28 contains pointers (0, 1, 3). Pointer “0” refers to the coordinates in element “0” of vertex array 24; pointer “1” refers to the coordinates in element “1” of vertex array 24; and pointer “3” refers to the coordinates in element “3” of vertex array 24. The three coordinates referred to by the pointers in face array 28 make up a polygon, in this case, a triangle, of adaptive 3D mesh 10.

[0020] By using face array 28 to reference coordinates in vertex array 24, vertices can be shared by more than one polygon (i.e., by different polygons referencing the same vertex). As a result, each vertex need only be stored once, reducing the amount of data required for an adaptive 3D mesh. Moreover, graphics accelerator cards can process arrays, such as those shown in FIG. 4, relatively efficiently.

[0021] As was the case with vertex array 24, face array 28 does not store pointers in numbered elements that are greater than a predetermined number. This keeps the size of face array 28 relatively manageable. Pointers that are added to face array 28 are added to the “holes”, i.e., the empty elements, as described below. Thus, as was the case with vertex array 24, the need for a large face array is reduced.

[0022] The holes in face array 28 are stored in free face container 30. Free face container 30 identifies elements of face array 28 that do not contain pointers, i.e., it identifies the holes. Free face container 30 stores pointers to such elements. In this embodiment, the pointers are the numbers of the elements containing holes (e.g., elements “1”, “3” of free face container 30 correspond to “empty” elements “1”, “3”, respectively, in face array 28).

[0023]FIG. 3 shows a process 20 for generating database 22. To generate database 22, process 20 stores (40) coordinates of 3D mesh 10 in elements of vertex array 24 (FIG. 4). As noted, these coordinates specify a point in 3D space (e.g., Cartesian XYZ coordinates) and may include additional information such as texture and/or color coordinates. Process 20 also stores (42), in face array 28, pointers to coordinates in vertex array 24. As noted above, the coordinates of vertex array 24 specified by the pointers in face array 28 define faces of polygons that make up 3D mesh 10. In both face array 28 and vertex array 24, any elements that do not contain coordinates or pointers include “empty” indications. Process 20 also initializes (44) free vertex container 26 and free face container 30, such that each element thereof is empty.

[0024] Once the database has been generated (40, 42, 44), the database may be updated. It is noted that vertex array 24 may be updated prior to generating face array 28 even though this is not specifically reflected in FIG. 3.

[0025] To remove a polygon from 3D mesh 10 (e.g., if the virtual camera changes position), process 20 removes (40) pointers to coordinates from an element of face array 28 that defines the polygon; stores (48), in that element, an indication that the element is empty; and stores (50), in free face container 30, a pointer to the element. The pointer in free face container 30 indicates that the element is empty. The pointer is stored at the first available element in free face container 30 from its top, meaning that the pointer is not necessarily appended to the end of free face container 30.

[0026] To add a polygon to 3D mesh 10 (e.g., if the virtual camera changes position), process 20 searches (52) free face container 30 for a lowest numbered element that does not contain pointers, i.e., for the lowest numbered element that contains a “hole”. Process 20 stores (54) new pointers to target coordinates in that element. Thus, rather than simply appending new pointers to elements at the end of face array 28, process 20 stores the new pointers at empty elements, thereby holding-down the size of face array 28.

[0027] To remove coordinates from 3D mesh 10 (e.g., if the virtual camera changes position), process 20 removes (56) the coordinates from an element of vertex array 24; stores (58), in that element, an indication that the element is empty; and stores (60), in free vertex container 26, a pointer to the element. The pointer in free vertex container 26 indicates that the element is empty. The pointer is stored at the first available element in free vertex container 26 from its top, meaning that the pointer is not necessarily appended to the end of free vertex container 26.

[0028] If process 20 removes coordinates from vertex array 24 that are referenced by face array 28, a graphics accelerator card may encounter errors when trying to render the 3D mesh. Accordingly, if coordinates are removed that are also referenced in face array 28, the pointers in face array 28 that reference those coordinates should also be removed.

[0029] To add coordinates to 3D mesh 10 (e.g., if the virtual camera changes position), process 20 searches (62) free vertex container 26 for a lowest numbered element that does not contain coordinates, i.e., for the lowest numbered element that contains a “hole”. Process 20 stores (64) new coordinates in that element. Thus, rather than simply appending new coordinates to elements at the end of vertex array 24, process 20 stores the new coordinates at empty elements, thereby holding-down the size of vertex array 24.

[0030] It is noted that adding/removing pointers and/or coordinates from face array 28 and vertex array 24, respectively, may be performed at any time. The order shown in FIG. 3 is merely an example of when adding/removing pointers and coordinates may occur.

[0031]FIG. 5 is a block diagram that shows how one embodiment of the invention operates. In the embodiment of FIG. 5, a 3D graphics application 66 provides virtual camera parameters 68 (e.g., coordinates of the location of the camera) and 3D mesh 10 to an adaptive metric program 70 that determines which polygons of the 3D mesh are to be added/removed based on the camera parameters. Data 72, which specifies the polygons of 3D mesh 10 that are to be added/removed from the 3D mesh, is provided to process 20, where the appropriate operations are performed with respect to database 22. Vertex array 24 and face array 28 are provided to a 3D API (Application Programming Interface 74), which generates a 3D model. The 3D model is displayed on display screen 76.

[0032]FIG. 6 shows a computer 78 on which process 20 and the embodiment of FIG. 5 may be implemented. Computer 78 includes display screen 76, processor 80, memory 82 (e.g., a hard disk), and 3D graphics accelerator card 84 for processing 3D data (see view 86) in accordance with process 20 (with or without assistance from processor 80). Memory 82 stores 3D data 88 for 3D mesh 10, 3D graphics application 66, adaptive metric program 70, machine-executable instructions 90 for performing process 20, and 3D API 74. Memory 82 may also store database 22 or it may be stored on another memory (not shown), either internal, or external, to computer 78.

[0033] Process 20, however, is not limited to use with any particular hardware or software configuration; it may find applicability in any computing or processing environment. Process 20 may be implemented in hardware, software, or a combination of the two. Process 20 may be implemented in one or more computer programs executing on programmable computers that each include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and one or more output devices. Program code may be applied to data entered using an input device to perform process 20 and to generate output information. The output information may be applied to one or more output devices.

[0034] Each such program may be implemented in a high level procedural or object-oriented programming language to communicate with a computer system. However, the programs can be implemented in assembly or machine language. The language may be a compiled or an interpreted language.

[0035] Each computer program may be stored on a storage medium, article or device (e.g., CD-ROM, hard disk, or magnetic diskette) that is readable by a general or special purpose programmable computer (or, more generally, machine) for configuring and operating the computer when the storage medium or device is read by the computer to perform process 20. Process 20 may also be implemented as a computer-readable storage medium, configured with a computer program, where, upon execution, instructions in the computer program cause the computer to operate in accordance with process 20.

[0036] Other embodiments not described herein are also within the scope of the following claims. For example, process 20 can be performed on any type of 3D mesh, not just 3D landscape meshes. Process 20 can be performed using adaptive simplification techniques other than those described above. The blocks of process 20 can be performed in a different order from that shown in FIG. 3. 

What is claimed is:
 1. A database stored on a machine-readable medium, the database comprising: a vertex array that contains coordinates of a three-dimensional mesh; and a face array that contains pointers to target coordinates in the vertex array, the target coordinates defining a polygon in the three-dimensional mesh.
 2. The database of claim 1, further comprising: a free vertex container that identifies elements in the vertex array that do not contain vertices.
 3. The database of claim 2, wherein the free vertex container identifies elements in the vertex array using pointers.
 4. The database of claim 1, further comprising: a free face container that identifies elements in the face array that do not contain pointers.
 5. The database of claim 4, wherein the free face container identifies elements in the face array using pointers.
 6. The database of claim 1, further comprising: a free vertex container that identifies elements in the vertex array that do not contain vertices; and a free face container that identifies elements in the face array that do not contain pointers.
 7. The database of claim 1, wherein elements of the vertex array contain additional information relating to vertices in the vertex array.
 8. The database of claim 7, wherein the additional information comprises at least one of texture coordinates and color information for vertices in the vertex array.
 9. The database of claim 1, wherein: the vertex array is comprised of numbered elements, each of the numbered elements in the vertex array containing either a coordinate or an indication that the element is empty; and the face array is comprised of numbered elements, each of the numbered elements in the face array containing either pointers or an indication that the element is empty.
 10. The database of claim 9, wherein: the vertex array does not store coordinates in elements that exceed a first predetermined number; and the face array does not store pointers in elements that exceed a second predetermined number.
 11. A method of generating a database that defines a three-dimensional mesh, comprising: storing coordinates of the three-dimensional mesh in a vertex array; and storing, in a face array, pointers to target coordinates in the vertex array, the target coordinates defining a polygon in the three-dimensional mesh.
 12. The method of claim 11, further comprising: removing coordinates of the three-dimensional mesh from an element of the vertex array; storing, in the element, an indication that the element is empty; and storing, in a free vertex container, a pointer to the element.
 13. The method of claim 12, wherein the element is numbered and wherein the pointer comprises a number of the element.
 14. The method of claim 13, further comprising: searching the free vertex container for a lowest numbered element that does not contain coordinates; and storing new coordinate values in the vertex array at the lowest numbered element specified in the free vertex container.
 15. The method of claim 11, further comprising: removing pointers to target coordinates from an element of the face array; storing, in the element, an indication that the element is empty; and storing, in a free face container, a pointer to the element.
 16. The method of claim 15, wherein the element is numbered and wherein the pointer comprises a number of the element.
 17. The method of claim 16, further comprising: searching the free face container for a lowest numbered element that does not contain pointers; and storing new pointers to target coordinates in the face array at the lowest numbered element specified in the free face container.
 18. An article comprising a machine-readable medium that stores instructions for generating a database that defines a three-dimensional mesh, the instructions causing a machine to: store coordinates of the three-dimensional mesh in a vertex array; and store, in a face array, pointers to target coordinates in the vertex array, the target coordinates defining a polygon in the three-dimensional mesh.
 19. The article of claim 18, further comprising instructions that cause the machine to: remove coordinates of the three-dimensional mesh from an element of the vertex array; store, in the element, an indication that the element is empty; and store, in a free vertex container, a pointer to the element.
 20. The article of claim 19, wherein the element is numbered and wherein the pointer comprises a number of the element.
 21. The article of claim 20, further comprising instructions that cause the machine to: search the free vertex container for a lowest numbered element that does not contain coordinates; and store new coordinate values in the vertex array at the lowest numbered element specified in the free vertex container.
 22. The article of claim 18, further comprising instructions that cause the machine to: remove pointers to target coordinates from an element of the face array; store, in the element, an indication that the element is empty; and store, in a free face container, a pointer to the element.
 23. The article of claim 22, wherein the element is numbered and wherein the pointer comprises a number of the element.
 24. The article of claim 23, further comprising instructions that cause the machine to: search the free face container for a lowest numbered element that does not contain pointers; and store new pointers to target coordinates in the face array at the lowest numbered element specified in the free face container.
 25. An apparatus for generating a database that defines a three-dimensional mesh, comprising: a memory that stores executable instructions; and a processor that executes the instructions to: store coordinates of the three-dimensional mesh in a vertex array; and store, in a face array, pointers to target coordinates in the vertex array, the target coordinates defining a polygon in the three-dimensional mesh.
 26. The apparatus of claim 25, wherein the processor executes instructions to: remove coordinates of the three-dimensional mesh from an element of the vertex array; store, in the element, an indication that the element is empty; and store, in a free vertex container, a pointer to the element.
 27. The apparatus of claim 26, wherein the element is numbered and wherein the pointer comprises a number of the element.
 28. The apparatus of claim 27, wherein the processor executes instructions to: search the free vertex container for a lowest numbered element that does not contain coordinates; and store new coordinate values in the vertex array at the lowest numbered element specified in the free vertex container.
 29. The apparatus of claim 25, wherein the processor executes instructions to: remove pointers to target coordinates from an element of the face array; store, in the element, an indication that the element is empty; and store, in a free face container, a pointer to the element.
 30. The apparatus of claim 29, wherein the element is numbered, the pointer comprises a number of the element, and the processor executes instructions to: search the free face container for a lowest numbered element that does not contain pointers; and store new pointers to target coordinates in the face array at the lowest numbered element specified in the free face container. 